﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace FrameworkXNA.Scenes
{
    class Fonte : SceneBase
    {
        SpriteFont fonte;

        int contador;
        int segundos;
        int cliques;
        int cps;
        
        public override void start()
        {
            fonte = Game1.instance.Content.Load<SpriteFont>("arial28");
            base.start();
        }

        public override void update(GameTime gameTime)
        {
            contador++;

            if (contador % 60 == 0)
            {
                segundos++;
            }

            if (Controller.MouseLeftPressed())
            {
                cliques++;
            }

            if(segundos != 0)
            cps = cliques / segundos;

            base.update(gameTime);
        }

        public override void draw(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(fonte, contador.ToString(), new Vector2(100, 100), Color.Black);
            spriteBatch.DrawString(fonte, segundos.ToString(), new Vector2(100, 150), Color.Black);
            spriteBatch.DrawString(fonte, cliques.ToString(), new Vector2(100, 200), Color.Black);
            spriteBatch.DrawString(fonte, cps.ToString(), new Vector2(100, 250), Color.Black);
            base.draw(spriteBatch);
        }
    }
}
